<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8"/>
      <title>网上订单</title>
   </head>
   
   <body>
      <script type="text/javascript">
      function foo(something){
         console.log(this.a , something);
         return this.a + something;
      }
      var obj = {
         a:2
      };
      var bar = function(){
         //arguments是一个传入函数内的变量数组 哪怕函数没有形参也会自动生成这一个数组用于存储接受参数
         return foo.apply(obj,arguments);
      };

      var b = bar(3);
      console.log(b);
      </script>
   </body>
</html>
